<#include "head_bus.ftl">
<script>
window.onload=function(){
	$("title").html("资金管理");
}
</script>
<!--内容开始-->
<div class="container">
    <div class="row">
        <div class="col-xs-12">
            <h2 class="title text-center"><span>我的钱包</span></h2>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12">
            <h3 class="text-center f36 mt0 col9">[<span class="pad10 bgC f18" style="vertical-align:middle;">账户余额：<span class="colC fb"><em class="f30">${balance} 元</em></span></span>]</h3>
        </div>
    </div>    
    <ul class="items">
        <li>
            <div class="item"  data-toggle="modal" data-target="#modal-18" data-dismiss="modal" data-backdrop="static">
                <a class="icon-1 icon-12" href="###">
                    <span>充值</span>
                </a>
                <!--<div class="item-box">
                    <span>了解详情</span>
                </div>-->
            </div>
        </li>
        <li>
            <div class="item">
                <a class="icon-1 icon-13" href="###">
                    <span>购买服务</span>
                </a>
                <div class="item-box">
                    <span>暂未开通</span>
                </div>
            </div>
        </li>
        <li class="nomar">
             <div class="item">
                <a class="icon-1 icon-14" href="${BASE_PATH}/fund/jydetail.htm" target="_blank">
                    <span>交易明细</span>
                </a>
                <!--<div class="item-box">
                    <span>了解详情</span>
                </div>-->
            </div>           
        </li>
    </ul>   
</div>
<!-- 弹出层 -->
<!-- 充值 -->
<div class="modal fade" id="modal-18">
    <div class="modal-dialog">
        <div class="modal-content">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">×</a>   
               <h4><span>充值方式</span></h4>
           </div>
           <div class="modal-body text-center">
                <form action="">     
                <div class="form-group f16 ptb30">
                    <label class="checkbox-inline">
                      <input type="radio" name="optionsRadiosinline"
                         value="option1" data-toggle="modal" data-target="#modal-19" data-dismiss="modal" data-backdrop="static"> 银联
                   </label>
                   <label class="checkbox-inline pl150">
                      <input type="radio" name="optionsRadiosinline" 
                         value="option2"  data-toggle="modal" data-target="#modal-20" data-dismiss="modal" data-backdrop="static"> 支付码
                   </label>                   
                </div>         
                <div class="form-group">
                      <div class="text-center">
                          <button type="button" class="btn btn-180 btn-cyan" data-dismiss="modal" >取消</button>
                      </div>
                   </div>
                </form>
           </div>
        </div>
    </div>
</div>
<!-- 银联支付 -->
<div class="modal fade" id="modal-19">
    <div class="modal-dialog">
        <div class="modal-content">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">×</a>   
               <h4><span>银联支付</span></h4>
           </div>
           <div class="modal-body text-center way way-1">
                <form class="form-horizontal f15" method="post">
                   <div class="form-group">
                      <label class="col-sm-4 col-xs-4 control-label">登录账号：</label>
                      <div class="col-sm-7 col-xs-7">
                          <p class="form-control-static text-left">${myaccount}</p>
                      </div>
                   </div>
                    <div class="form-group">
                      <label class="col-sm-4 col-xs-4 control-label">账户余额：</label>
                      <div class="col-sm-7 col-xs-7" >
                          <p class="form-control-static text-left">${balance} 元</p>
                      </div>
                   </div>                  
                   <div class="form-group">
                      <label class="col-sm-4 col-xs-4 control-label">充值金额：</label>
                      <div class="col-sm-7  col-xs-7">
                         <input type="text" id="bank_money" class="form-control">
                      </div>
                   </div>                  
                    <div class="form-group">
                      <div class="text-center">
                           <!--<button type="button" class="btn btn-s btn-120"  data-toggle="modal" data-target="#modal-21" data-dismiss="modal" data-backdrop="static">确定</button>-->
                      
                          <button type="button" class="btn btn-s btn-120" onclick="doRecharge('2')">确定</button>
                          <button type="button" class="btn btn-s btn-120 btn-cyan ml80" data-dismiss="modal">取消</button>
                      </div>
                  </div>                                
                </form>
           </div>
        </div>
    </div>
</div>
<!-- 支付码支付 -->
<div class="modal fade" id="modal-20">
    <div class="modal-dialog">
        <div class="modal-content">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">×</a>   
               <h4><span>支付码支付</span></h4>
           </div>
           <div class="modal-body text-center way  way-1">
                <form class="form-horizontal f15" method="post">
                   <div class="form-group">
                      <label class="col-sm-4 col-xs-4 control-label">当前账号：</label>
                      <div class="col-sm-7">
                          <p id="reg_tel" class="form-control-static text-left">${myaccount}</p>
                      </div>
                   </div>
                    <div class="form-group">
                      <label class="col-sm-4 col-xs-4 control-label">账户余额：</label>
                      <div class="col-sm-7">
                          <p class="form-control-static text-left">${balance} 元</p>
                      </div>
                   </div>                  
                   <div class="form-group">
                      <label class="col-sm-4 col-xs-4 control-label">输入支付码：</label>
                      <div class="col-sm-7  col-xs-7">
                         <input type="text" id="paycode" class="form-control">
                      </div>
                   </div>                  
                    <div class="form-group">
                      <div class="text-center">
                          <!--<button type="button" class="btn btn-s btn-120" onclick="doRecharge('3')" data-toggle="modal" data-target="#modal-21" data-dismiss="modal" data-backdrop="static">确定</button>-->
            
                          <button type="button" class="btn btn-s btn-120" onclick="doRecharge('3')">确定</button>
                          <button type="button" class="btn btn-s btn-120 btn-cyan ml80" data-dismiss="modal">取消</button>
                      </div>
                  </div>                                
                </form>
           </div>
        </div>
    </div>
</div>
<script type="text/javascript">
	function doRecharge(payway)
	{	
		var money=$("#bank_money").val();
		if((!/^([1-9][\d]{0,7}|0)(\.[\d]{1,2})?$/.test(money) || parseFloat(money)==0) && payway !=3)
		{
			alert("金额输入错误！");
			return;
		}
	
		$.ajax({
  				type: "post",
				dataType:"json",
				url:"${BASE_PATH}/voucher/forMyself.json",
				data:{"reg_tel":$("#reg_tel").text(),"bank_money":$("#bank_money").val(),"pay_way":payway,"paycode":$("#paycode").val()},
				success:function(data)
				{
					if(data.result)
					{
						if(payway!=3)
							window.location.href=data.t;
						else
						{
							alert(data.msg);
							window.location.reload();
						}
						//alert("请在弹出页面进行支付！");
					}
					else
					{
						alert(data.msg);
					}	
				//window.location.reload();
				}
		});
	}
</script>
<!-- 支付成功 -->
<div class="modal fade" id="modal-21">
    <div class="modal-dialog modal-400">
        <div class="modal-content">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">×</a>   
           </div>
           <div class="modal-body text-center">
                <span class="glyphicon glyphicon-ok ok"></span><br/>
                <p class="h4 mt20">充值成功</p>
           </div>
        </div>
    </div>
</div>
<!-- 交易明细 -->
<div class="modal fade" id="modal-22">
    <div class="modal-dialog modal-870">
        <div class="modal-content">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">×</a>   
               <h4><span>账户交易记录</span></h4>
           </div>
           <div class="modal-body text-center">
                <div class="plr2 width55">
                    <div class="c-menu text-left">              
                        <span class="input-prepend input-group">
                            <label class="fl">开始时间：</label>
                            <input type="text" class="form-control dateNow int-193" value="" placeholder="请选择日期"/>--
                            <input type="text" class="form-control dateNow int-193" value="" placeholder="请选择日期"/>
                        </span>
                        <a href="" class="btn  btn-12 h34 ml2">查询</a>   
                        <a href="" class="btn  reset btn-12 h34 ml2">重置</a>                                              
                    </div>
                    <div class="c-data mb70">
                        <table>
                            <thead>
                                <tr>
                                    <th>交易时间</th>
                                    <th>交易类别</th>
                                    <th>金额</th>
                                    <th width="25%">合同（协议）编号</th>
                                </tr>
                            </thead>
                            <tbody>
                                <#list dataList as one>
                                <tr>
                                    <td>${one.create_time}</td>
                                    <td>${one.description}</td>
                                    <td>${one.bank_money}元</td>
                                    <td>无</td>
                                </tr>
                                </#list>
                         </tbody>
                        </table>
                    </div>  
                    <!-- 页码 -->
                    <center>
                    	共${totalCount}条记录, ${pageNo}/${pages} 页
						<#if (pageNo?int-5>=1) >
							<a  href="${BASE_PATH}/fund/fund.htm?pageNo=${pageNo-5}">上5页</a>
						</#if>
						<#if (pageNo>1) >
							<a  href="${BASE_PATH}/fund/fund.htm?pageNo=${pageNo-1}">上一页</a>
						</#if>
						<#if (pages>0) >
							<#list 1..pages as one>
								<#if (pageNo-one)==3>
									...
								<#elseif ((pageNo-one)<=2 && (pageNo-one)>=1) >
									<a  href="${BASE_PATH}/fund/fund.htm?pageNo=${one}">${one}</a>
								<#elseif pageNo==one>
							       ${one}
				              	<#elseif  ((one-pageNo)<=2 && (one-pageNo)>=1) >
										<a  href="${BASE_PATH}/fund/fund.htm?pageNo=${one}">${one}</a>
								<#elseif (one-pageNo)==3>
										...
								</#if>
							</#list>
						</#if>
						<#if pageNo<pages >
							<a  href="${BASE_PATH}/fund/fund.htm?pageNo=${pageNo++1}">下一页</a>
						</#if>
						<#if (pageNo+5)<=pages >
							<a  href="${BASE_PATH}/fund/fund.htm?pageNo=${pageNo+5}">下5页</a>
						</#if>
		           </center>
                </div>
           </div>
        </div>
    </div>
</div>
<!-- 日期控件 -->
<script type="text/javascript" src="${BASE_PATH}/static/business/js/moment.min.js"></script>
<script type="text/javascript" src="${BASE_PATH}/static/business/js/daterangepicker.js"></script> 

<#include "foot_bus.ftl">